package com.lzx.article.controller.web;


import com.lzx.article.entity.GiveALike;
import com.lzx.article.service.GiveALikeService;
import com.lzx.common.utils.R;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/article/giveALike/web")
public class WebGiveALikeController {
    @Resource
    private GiveALikeService giveALikeService;

    //查询当前用户的点赞记录
    @GetMapping("/getUserGiveALikeList/{userId}")
    public R getUserGiveALikeList(@PathVariable int userId) {
        return giveALikeService.getUserGiveALikeList(userId);
    }

    //点赞功能
    @PostMapping("/saveUserGiveALike")
    public R saveUserGiveALike(@RequestBody GiveALike giveALike) {
        return giveALikeService.saveUserGiveALike(giveALike);
    }
}
